<template>
  <div class="app-container">
    <div style="background: rgb(244, 244, 245);margin: 10px;padding: 20px;text-align: center">
      <div style="margin-bottom: 10px">
        <el-input v-model="number" placeholder="请输入快递单号" style="width: 50%" />
      </div>
      <el-button @click="handelJD" plain type="danger" icon="404">
         京东查询
      </el-button>
      <el-button @click="handelSF" plain type="primary">顺丰查询</el-button>
    </div>

    <!--  快递100查询  -->
    <div>
      <iframe name="kuaidi100" src="https://www.kuaidi100.com/frame/index.html" width="100%" height="880" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>
    </div>
  </div>
</template>

<script>
  import * as url from "url";

  export default {
    name:"ExpressInquiry",
    computed: {
      url() {
        return url
      }
    },
    data() {
      return {
        number: undefined
      }
    },
    created() {

    },
    methods: {
      handelSF() {
        if(!this.number){
          this.msgWarning("请输入快递单号");
          return
        }
        window.open("https://www.kuaidi100.com/all/sf.shtml?nu=" + this.number)
      },
      handelJD() {
        if(!this.number){
          this.msgWarning("请输入快递单号");
          return
        }
        window.open("https://www.kuaidi100.com/all/jd.shtml?nu=" + this.number)
      },
    }
  }
</script>

<style scoped lang="scss">

</style>
